home *** CD-ROM | disk | FTP | other *** search
/ CICA 1997 August / CICA - The Ultimate Collection of Shareware for Windows (Walnut Creek) (August 1997) (Disc 1).iso / utils / unix / unzip520 / wingui / rename.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-24  |  1.5 KB  |  54 lines

  1. #include <stdio.h>
  2. #include "wingui\wizunzip.h"
  3. #include "wingui\rename.h"
  4. #include "wingui\helpids.h"
  5.  
  6. /****************************************************************************
  7.  
  8.     FUNCTION: RenameProc(HWND, WORD, WPARAM, LPARAM)
  9.  
  10.     PURPOSE:  Processes messages for "Rename" dialog box
  11.  
  12.     MESSAGES:
  13.                                     
  14.     WM_INITDIALOG - initialize dialog box
  15.     WM_COMMAND    - Input received
  16.  
  17. ****************************************************************************/
  18.  
  19. BOOL WINAPI RenameProc(HWND hDlg, WORD wMessage, WPARAM wParam, LPARAM lParam)
  20. {
  21.     static char __far *lpsz;
  22.  
  23.     switch (wMessage)
  24.     {
  25.     case WM_INITDIALOG:
  26.         lpsz = (char __far *)lParam;
  27.         wsprintf(lpumb->szBuffer, "Rename %s", (LPSTR)lParam);
  28.         SetDlgItemText(hDlg, IDM_RENAME_TEXT, lpumb->szBuffer);
  29.         wsprintf(lpumb->szBuffer, "%s", (LPSTR)lParam);
  30.         SetDlgItemText(hDlg, IDM_NEW_NAME_TEXT, lpumb->szBuffer);
  31.         CenterDialog(GetParent(hDlg), hDlg); /* center on parent */
  32.         return TRUE;
  33.  
  34.     case WM_SETFOCUS:
  35.         SetFocus(GetDlgItem(hDlg, IDM_NEW_NAME_TEXT));
  36.         return TRUE;
  37.  
  38.     case WM_COMMAND:
  39.         switch (LOWORD(wParam))
  40.         {
  41.         case IDM_RENAME_RENAME:
  42.             GetDlgItemText(hDlg, IDM_NEW_NAME_TEXT, lpsz, 80);
  43.         case IDM_RENAME_CANCEL:
  44.             EndDialog(hDlg, wParam);
  45.             break;
  46.         case IDM_RENAME_HELP:
  47.             WinHelp(hDlg,szHelpFileName,HELP_CONTEXT, (DWORD)(HELPID_OVERWRITE));
  48.         }
  49.         return TRUE;
  50.     }
  51.     return FALSE;
  52. }
  53.  
  54.